#ifndef CHASSIS_H
#define CHASSIS_H
#include "LK_motor.h"
#include "robot_def.h"
#include "dji_motor.h"
#include "super_cap.h"
#include "message_center.h"
#include "referee_task.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "general_def.h"
#include "bsp_dwt.h"
#include "referee_UI.h"
#include "drv_math.h"
#include "light_gate.h"
#include "energy_sampling.h"

enum
{
    left=0,
    right=1,
};
typedef struct
{
    LKMotorInstance *motor;    //目前轮向电机我们只选了翎控
    float Target_Wheel_Omega;  //目标轮向电机的角速度

} Motor_Wheel_s;        //轮向电机类
typedef struct
{
    DJIMotorInstance *motor;    //目前舵向电机我们只选了DJI电机
    float zero_angle;           //零点角度
    float Target_Steer_Angle;   //目标舵向电机的角度
    uint8_t find_zero_flag;     //是否已经找到零点,初始为0，校准完成为1
} Motor_Steer_s;        //舵向电机类
typedef struct
{
    float Taget_chassis_vx;
    float Taget_chassis_vy;
    float Taget_chassis_wz;
    float Now_chassis_vx;
    float Now_chassis_vy;
    float Now_chassis_wz;
} Chassis_Velocity_s;   //底盘速度类
#ifdef  POWER_PRIORITY//功率优先
typedef enum
{
    POWER_LEVEL_1=60,
    POWER_LEVEL_2=65,
    POWER_LEVEL_3=70,
    POWER_LEVEL_4=75,
    POWER_LEVEL_5=80,
    POWER_LEVEL_6=85,
    POWER_LEVEL_7=90,
    POWER_LEVEL_8=95,
    POWER_LEVEL_9=100,
    POWER_LEVEL_10=100
}power_level_e;
#else//#define HEALTH_PRIORITY       // 血量优先
typedef enum
{
    POWER_LEVEL_1=45,
    POWER_LEVEL_2=50,
    POWER_LEVEL_3=55,
    POWER_LEVEL_4=60,
    POWER_LEVEL_5=65,
    POWER_LEVEL_6=70,
    POWER_LEVEL_7=75,
    POWER_LEVEL_8=80,
    POWER_LEVEL_9=90,
    POWER_LEVEL_10=100
}power_level_e;
#endif // !



/**
 * @brief 底盘应用初始化,请在开启rtos之前调用(目前会被RobotInit()调用)
 * 
 */
void ChassisInit();

/**
 * @brief 底盘应用任务,放入实时系统以一定频率运行
 * 
 */
void ChassisTask();

#endif // CHASSIS_H